<div class="w950">
    <div id="step1" class="bg_top_main p15t">
        <div class="w878 mc p10t">
            <img src="<?php echo $this->layoutUrl ?>images/3step.png" alt=""/>
            <table cellpadding="0" cellspacing="3" width="878" align="center">
                <tr>
                    <td width="251" align="center" valign="middle" height="55">
                        <p class="fs16 gray_color">Create a stponsored video, tweet, or blog post</p>
                    </td>
                    <td width="69">&nbsp;</td>
                    <td width="251" align="center" valign="middle" height="55"><p class="fs16 gray_color">Earn money each time you receive a click or view</p></td>
                    <td width="69">&nbsp;</td>
                    <td width="251" align="center" valign="middle" height="55"><p class="fs16 gray_color">Get paid weekly with Paypal or Amazon Gift Cards</p></td>
                </tr>
            </table>

        </div>
        <div class="p10b w890 mc p15t">
            <h2 class=" green"><b class="float_left showIconLoad1">Thông tin đăng ký</b><br class="cl" /></h2>
        </div>
        <div class="w890 mc gray_bo p15b p15t">
            <div class="w860 mc">
                <div class="float_left">
                    <script type="text/javascript">
                        myAds.onSubmitForm('#registerForm', '#captcha-element', true, true, false, function(data){                            
                            data = data.split('|*|');
                            if(data[0] == 'true'){
                                jQuery('#step1').fadeOut('fast', function(){                                      
                                    <?php 
                                    if($this->GroupID == 3){
                                        ?>
                                        window.location = '<?php echo $this->url(array("controller" => 'user', "action" => "sponsorprofile")) ?>';              
                                        <?php
                                    }else{
                                        ?>
                                        jQuery('#step2').fadeIn();
                                        jQuery('#step1').remove();  
                                        jQuery('#UserID').val(data[1]);    
                                        <?php                                        
                                    }
                                    ?>
                                       
                                });                                
                            }
                        });
                    </script>
                    <div id="registerFormStep1Container">
                        <form id="registerForm" method="POST" action="<?php echo $this->url(array("controller" => 'user', "action" => "register")); ?>" >
                            <label class="lbl1">Email:</label>
                            <input name="data[email]" type="text" class="txt3 required email"/><br />
                            <label class="lbl1">Tên:</label>
                            <input name="data[name]" type="text" class="txt3 required"/><br />
                            <label class="lbl1">Kí danh:</label>
                            <input name="data[nickName]" type="text" class="txt3 required"/><br />
                            <label class="lbl1">Mật khẩu:</label>
                            <input name="data[password]" type="password" class="txt3 required"/><br />
                            <?php echo $this->captcha->render($this) ?>
                            <br />
                            <label class="lbl1">&nbsp;</label>
                            <p class="gray_color float_left" style="padding: ">
                                <input style="padding-top: 2px" value="1" class="required" name="" id="acceptTerm" type="checkbox" />
                                <span>&nbsp;Tôi chấp nhận điều khoản sử dụng dịch vụ</span>
                            </p><br class="cl" />
                            <br class="cl" />
                            <label class="lbl1">&nbsp;</label> 
                            <div class="red_bg float_left">
                                <a id="btnSubmitRegisterForm" href="javascript:void(0);" onclick="
                                    myAds.showLoadingIcon('.showIconLoad1');
                                    jQuery('#registerForm').submit();                                
                                ">ĐĂNG KÝ</a></div>
                            <div class="cb"></div>
                            <input type="hidden" value="<?php echo $this->GroupID == 3? $this->GroupID:2 ?>" name="data[GroupID]" />
                        </form>
                    </div>
                </div>
                <div class="float_right">
                    <div class="bg_fb_btn">
                        <a href="#">CONNECT WITH FACEBOOK</a>
                    </div>
<!--                    <div class="bg_yt_btn">
                        <a href="<?php echo $this->youtubeAuthenticateUri ?>">CONNECT WITH YOUTUBE</a>
                    </div>-->
                </div>
                <div class="cb"></div>
            </div>
        </div>

    </div>
    <div id="step2" class="bg_top_main p15t" style="display: none">
        <div class="p10b w890 mc p15t"><h2 class="green"><b>Chọn chủ đề mà bạn muốn quảng cáo </b></h2>
            <p>(Chọn ít nhất 2 chủ đề và nhiều nhất là 10 chủ đề)</p>
        </div>
        <div class="w890 mc gray_bo p15b p15t">
            <div class="w860 mc">
                <form id="regisCategory" method="POST" onsubmit="" action="<?php echo $this->url(array("controller" => 'user', "action" => "registercategory")); ?>" > 
                    <div class="br_b">
                        <script type="text/javascript">
                            function checkNumberOfCat(_this){
                                if(jQuery('#catNumber').val() > 10 && jQuery(_this).attr('checked') ){
                                    jQuery(_this).attr('checked', false);
                                    var data  = new Array();
                                    data['message'] = 'Bạn đã vượt quá só lượng chủ đề tối đa là 10';
                                    data['status'] = 'error';
                                    myAds.sendMessage(data);
                                }else {
                                    if(jQuery(_this).attr('checked')){
                                        var num = jQuery('#catNumber').val();
                                        jQuery('#catNumber').val( parseInt(num)+1)
                                    }else{
                                        var num = jQuery('#catNumber').val();
                                        jQuery('#catNumber').val( parseInt(num)-1)
                                    }
                                }
                            }
                    function checkMinimumCat(){
                        if(jQuery('#catNumber').val() > 1){
                            return true;
                        }else{
                            var data  = new Array();
                            data['message'] = 'Xin vui lòng chọn ít nhất một chủ đề';
                            data['status'] = 'error';
                            myAds.sendMessage(data);
                            return false
                        }
                                    
                    }
                        </script>

                        <table align="center" width="860" cellpadding="0" cellspacing="8">
                            <tr>
                                <?php
                                if (count($this->categories) > 0 && is_array($this->categories)) {
                                    $i = 0;
                                    foreach ($this->categories as $v) {
                                        if ($i % 4 == 0 && $i != 0) {
                                            echo "</tr><tr>";
                                        }
                                        echo '<td width="25%" align="left" valign="top" height="20">
                                            <input autocomplete="off" onclick="checkNumberOfCat(this)" class="catInput" name="categoryID[]" type="checkbox" value="' . $v['categoryID'] . '" />
                                            &nbsp;' . $v['categoryTitle'] . '
                                            </td>';
                                        $i++;
                                    }
                                }
                                ?>
                            </tr>

                        </table>
                        <input autocomplete="off" type="hidden" value="1" id="catNumber" />
<!--                        <input autocomplete="off" type="hidden" value="" name="UserID" id="UserID" />-->
                    </div>

                    <p class="p15t">
                        <input type="checkbox" value="1" name="receiveEmail" />
                        &nbsp;Nhận email khi có chiến dịch quảng cáo mới
                    </p>
                    <br />
                    <div class="red_bg float_left">
                        <a href="javascript:void(0)" onclick="if(checkMinimumCat()) jQuery('#regisCategory').submit()">Lưu</a>
                    </div>
                </form>
                <div class="cl"></div>
            </div>
        </div>
    </div>
</div>